package provider;

import netty.NettyClint;
import publicInterface.HelloService;

public class ClientBootstrap {
    //这里定义协议头
    public static final String providerName = "helloService#hello#";

    public static void main(String[] args) throws  Exception{

        //创建一个消费者
        NettyClint customer = new NettyClint();

        //创建代理对象
        HelloService service = (HelloService) customer.getBean(HelloService.class, providerName);

//        for (;; ) {
            Thread.sleep(2 * 100);
            //通过代理对象调用服务提供者的方法(服务)
            String res = service.hello("你好 dubbo~");
            System.out.println("调用的结果 res= " + res);
//        }
    }
}
